var arr = [1,1,1,1,1,1,1,1,1,'1','1',1,1,1,1,1,1,1,1,1]

function unique(arr) {
    let res = []
    for(let i = 0; i < arr.length; i++) {
        let first = arr.indexOf(arr[i]);
        let last = arr.lastIndexOf(arr[i]);
        // console.log(first,last);
        if(first !== last) {
            arr.splice(i,1)
            i--
        }
    }
    return arr
}

console.log(unique(arr) );